VR10UWrToBin

V = Variables

R = Reading functions

UNSIGNED WORD —→ BINARY

The VR10UwrToBin function converts a Unsigned Word variable type (word without sign) in a Binary variable type.

IMPLEMENTATION

VR10UWrToBin (value, index, array, errcode)

Parameters:

IN/OUTVARIABLE TYPEEXAMPLE NAMEDIM
IN GLOBAL value L Data value to convert
IN GLOBAL index L Index of the array element to start the “deposit” of the converted data
OUT ARRGBL array B Array containing the converted data (must be declared with at least “index + 1” items)
OUT GLOBAL errcode F Variable that indicates a possible error on the function

Errcode

Una volta richiamata la funzione, 'errcode' può assumere determinati valori, il significato di tali valori è riassunto di seguito:
0: Nessun errore
1: Errore: il dato di ritorno è minore di 0 oppure maggiore di 65535

Esempio

Trasforma il valore 40000 (unsigned word) in un valore binario

value = 40000
index = 1
 
VR10UWrToBin (value, index, array, errcode)
 
;Sull'array si troverà :
; array[1] = -100
; array[2] = 64

Note